new Vue({
    el:"#notice",
    data:{
        placenotices:[],
    },
    filters: {
        formatDate: function (value) {
            let date = new Date(value);
            let y = date.getFullYear();
            let MM = date.getMonth() + 1;
            MM = MM < 10 ? ('0' + MM) : MM;
            let d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            return y + '-' + MM + '-' + d ;
        }
    },
    methods:{
        getPlaceNotice(){
            var list;
            $.ajax({
                // 设置json的属性和值
                url: "/getPlaceNotice",
                contentType: "application/json;charset=UTF-8",
                data: null,
                async:false,
                type: "get",
                success: function (data) {
                    list = data
                }
            })
            this.placenotices = list
        },
        deletePlaceNotice(noticeid,index){
            $.ajax({
                // 设置json的属性和值
                url: "/deletePlaceNotice",
                contentType: "application/json;charset=UTF-8",
                data: {'noticeid':noticeid},
                async:false,
                type: "get",
                success: function (data) {
                }
            })
            this.placenotices.splice(index,1)
        }
    },
    created(){
        this.getPlaceNotice()
    }
})